package sg.edu.nus.iss.vmcs.store;

import java.io.IOException;

public abstract class ItemLoader {
	private IStoreLoader loader;

	public ItemLoader(IStoreLoader loader) {
		super();
		this.loader = loader;
	}
	
	public void save(){
		try {
			loader.save();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public int getNumOfItems(){
		return loader.getNumOfItems();
	}
	
	public void setNumOfItems(int num) {
		loader.setNumOfItems(num);
	}
	
	protected IStoreLoader getStoreLoader(){
		return this.loader;
	}
	
	public abstract StoreItem getItem(int index);
	
	public abstract void setItem(int index, StoreItem item);
}
